/**
 * Created by Administrator on 2017/4/26.
 */
//注册checkbox

$(".checkbox-btn").click(function(){
    var s=$(this).hasClass('checkbox-btn-active');
    if(s){
        $(this).removeClass( "checkbox-btn-active" );
    }else{
        $(this).addClass( "checkbox-btn-active" );
    }
});





$(document).ready(function (){
    $(".w-radio").eq(0).addClass("on_check");
    $(".w-radio").eq(0).children().attr("checked",true);
    $(".w-radio").on("click",function(){
        $(this).addClass("on_check").siblings().removeClass("on_check");
        $(".w-radio").children().attr("checked",false);
        $(this).children("input").attr("checked",true);
        if ($('#putong').attr('checked')=="checked") {
            $(".putongNone").hide();
        }else{
            $(".putongNone").show();
        }
    });
});

//发布帖子
$(".textareaInvitation").click(function(){
    $(".w-placeholder").hide();
});



//收藏
$("#cellect").on("click",function(){
    if($(this).hasClass("clickCellect")){
        $(this).removeClass("clickCellect");
        $(this).addClass("cancelCellect");
        $(this).html("取消收藏");
    }else{
        $(this).removeClass("cancelCellect");
        $(this).addClass("clickCellect");
        $(this).html("点击收藏");
    }
});


//点赞
//点赞
function addNum(e){
    var i=$(e).children("input").val();
    if($(e).children(".dianzan").hasClass("active")){
        $(e).children(".dianzan").removeClass("active");
        $(e).children(".dianzan").css("background-position","top,center");
        i--;
        $(e).children("input").val(i);
        $(e).children("span").html(i);
    }else{
        $(e).children(".dianzan").addClass("active");
        $(e).children(".dianzan").css("background-position","bottom,center");
        i++;
        $(e).children("input").val(i);
        $(e).children("span").html(i);
    }
}



//查看更多
var www=$(".huifuList");
$.each(www,function(k,obj){
        $(obj).children("p:gt(1)").hide();
    }
);
function showList(e){
    if($(e).hasClass("zhankai")){
        $(e).removeClass("zhankai");
        $(e).html("点击收起");
        $(e).parent().children("p").show();
    }else{
        $(e).addClass("zhankai");
        $(e).html("查看更多回复");
        $(e).parent().children("p:gt(1)").hide();
    }
}



////添加人
//$("#addPeople").click(function(){
//    $(".addPeople-ul").append("<ul class='list-group'>" +
//        "<li class='list-group-item'>" +
//        "<img src='img/importent.png' class='w-importent'>参与人姓名:<input type='text' class='form-control w-form-control' placeholder='请输入'>" +
//        "</li>"+
//        "<li class='list-group-item'>"+
//        "<img src='img/importent.png' class='w-importent'>联系电话:<input type='tel' class='form-control w-form-control' placeholder='请输入'>"+
//        "</li>"+
//        "<li class='list-group-item'>"+
//        "<img src='img/transform.png' class='w-importent'>常用邮箱:<input type='email' class='form-control w-form-control' placeholder='请输入'>"+
//        "</li>"+
//        "<li class='list-group-item'>"+
//        "<img src='img/importent.png' class='w-importent'>所属行业:<input type='text' class='form-control w-form-control' placeholder='请输入'>" +
//        "</li>"+
//        "<li class='list-group-item'>"+
//        "<img src='img/importent.png' class='w-importent'>所属职位:<input type='text' class='form-control w-form-control' placeholder='请输入'>" +
//        "</li>" +
//        "<li class='list-group-item'>"+
//        "<img src='img/transform.png' class='w-importent'>有话要说:<textarea class='form-control w-form-control' rows='3' placeholder='请描述您在实物中遇到的困难或难题，主讲人可能在现场做出解答'></textarea>"+
//        "</li>" +
//        "</ul>")
//});

//添加人
$("#addPeople").click(function(){
    $(".addPeople-ul").append("<ul class='list-group list'>" +
        "<li class='list-group-item'>" +
        "<img src='/static/index/img/importent.png' class='w-importent'>参与人姓名:"+
        "<input type='text' class='form-control w-form-control' placeholder='请输入参与人姓名' name='name' maxlength='15'>" +
        "</li>"+
        "<li class='list-group-item'>"+
        "<img src='/static/index/img/importent.png' class='w-importent'>联系电话:"+
        "<input type='tel' class='form-control w-form-control' placeholder='请输入联系电话' name='tel' maxlength='11'>"+
        "</li>"+
        "<li class='list-group-item'>"+
        "<img src='/static/index/img/transform.png' class='w-importent'>常用邮箱:"+
        "<input type='email' class='form-control w-form-control' placeholder='请输入常用邮箱' name='email' maxlength='30'>"+
        "</li>"+
        "<li class='list-group-item'>"+
        "<img src='/static/index/img/importent.png' class='w-importent'>所属行业:"+
        "<input type='text' class='form-control w-form-control' placeholder='请输入您工作所在行业' name='industry' maxlength='18'>" +
        "</li>"+
        "<li class='list-group-item'>"+
        "<img src='/static/index/img/importent.png' class='w-importent'>所属职位:"+
        "<input type='text' class='form-control w-form-control' placeholder='请输入所属职位' name='position' maxlength='18'>" +
        "</li>" +
        "<li class='list-group-item'>"+
        "<img src='/static/index/img/transform.png' class='w-importent'>有话要说:"+
        "<textarea class='form-control w-form-control textarea' rows='2' placeholder='请描述您在实物中遇到的困难或难题，主讲人可能在现场做出解答'></textarea>"+
        "</li>" +
        "</ul>")
});

//录播下拉菜单显示隐藏
$(function(){
    $(".w-menu").hide();
    $(".w_menubtn .btn-group").click(function(){
        $("body").css("overflow-y","hidden");
        $(".w-menu").height($(window).height());
        $(this).children('button').addClass('w-rotate').addClass('w-red');
        $(".w-menu").hide().eq($(this).index()).show();
        $(this).siblings().children().hide();
    });
    $(".w-menu ul li").click(function (){
        $("body").css("overflow-y","scroll");
        $(".w-menu").hide();
        $(".nearby-btn").removeClass('w-rotate');
        var menuHtml=$(this).children("a").html();
        var menuid=$(this).parent().parent().attr("id");
        menuid=menuid.substring(11);
        if(menuid==1){
            $(".w-drop-menu1 span:first").text(menuHtml);
            $(".w-drop-menu2").show();
            $(".w-drop-menu3").show();
        }
        if(menuid==2){
            $(".w-drop-menu2 span:first").text(menuHtml);
            $(".w-drop-menu1").show();
            $(".w-drop-menu3").show();
        }
        if(menuid==3){
            $(".w-drop-menu3 span:first").text(menuHtml);
            $(".w-drop-menu1").show();
            $(".w-drop-menu2").show();
        }
    });
});





//查看更多

$(".lookmoreList>li:gt(1)").hide();
function lookMore(e){
    if($(e).hasClass("showMore")){
        $(".lookmoreList>li").show();
        $(e).html("点击收起");
        $(e).removeClass("showMore");
    }else{
        $(".lookmoreList>li:gt(1)").hide();
        $(e).html("显示更多评论");
        $(e).addClass("showMore");
    }
}

//是否是会员的弹窗
$("#tanchuang1").click(function(){
    $('#myModal1').modal('toggle')
});
$("#tanchuang0").click(function(){
    $('#myModal0').modal('toggle')
});


//视频详情
$(".videoDetailList li").click(function(){
    $(".videoDetailList li div").removeClass("w-redbg").removeClass("w-red");
    $(this).children("div:first").addClass("w-redbg");
    $(this).children("div:last").addClass("w-red");
});



$("#clickSeeMore").click(function(){
    if($("#fontmore").height()==100){
        $("#fontmore").css("height","auto");
        $(this).html("点击收起");
    }else{
        $("#fontmore").css("height","100");
        $(this).html("查看全部");
    }
});























